package com.flainsky.nirvanaplayer.globe;

import com.flainsky.nirvanaplayer.lib.objects.Movie;

import android.content.Context;

public class PlayController {
	private static PlayController instance;
	private static Context mContext;
	private String currentPlayUrl;
	
	public static PlayController getInstance() {
		if(instance!=null){
			return instance;
		}
		else{
			makeInstance(mContext);
			return instance;
		}
	}
	public static synchronized void makeInstance(Context context){
		mContext = context;
		if(instance==null){
			instance=new PlayController();
		}
	}
	public String getCurrentPlayUrl() {
		return currentPlayUrl;
	}
	public void setCurrentPlayUrl(String currentPlayUri) {
		this.currentPlayUrl = currentPlayUri;
	}
	
	public void setCurrentPlayMovie(Movie currentPlayMovie)
	{
		if(currentPlayMovie == null)return;
		HistroyController.getInstance().addHistroy(currentPlayMovie);
		this.currentPlayUrl = currentPlayMovie.mPlay_url;
	}
}
